import { createRouter,createWebHistory} from 'vue-router'

//定义路由关系
const routes=[
    {
        path:'/login',
        component:()=>import('../views/Login.vue')
    },
    {
        path:'/',
        component:()=>import('../views/Layout.vue'),
        redirect:'/article/manage', //默认显示的页面
        children:[
        {
            path:'/article/category',
            component: () => import('../views/Article/ArticleCategory.vue')
        },
        {
            path:'/article/manage',
            component: () => import('../views/Article/ArticleManage.vue')
        },
        {
            path:'/user/info',
            component: () => import('../views/user/UserInfo.vue')
        },
        {
            path:'/user/avatar',
            component: () => import('../views/user/UserAvatar.vue')
        },
        {
            path:'/user/resetPassword',
            component: () => import('../views/user/UserResetPassword.vue')
        },
       ]
    },
    {
        path:'/mainmenu',
        component:()=>import('../components/mainMenu.vue')
    },
    {
        path:'/mymenu',
        component:()=>import('../components/myMenu.vue')
    },
]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
});
//导出路由
export default router;